<div class="wrapper wrapper-content">
  <div class="row">
    <div class="col-sm-12">
        <div class="col-sm-6">
          <div class="row">
            <div id="ibox-search" class="ibox float-e-margins" style="margin-bottom: 0;">
              <div class="ibox-title">
                <h5>请输入查询条件</h5>
                <div ibox-tools="" class="ng-scope">
                  <div  dropdown="" class="ibox-tools dropdown">
                    <a  ng-click="showhide()"> <i class="fa fa-chevron-up"></i></a>
                  </div>
                </div>
              </div>
              <div id="search-content" class="ibox-content">
                <div class="row">
                  <div class="col-sm-4">
                    <div class="form-group col-sm-12">
                      <label for="image_patientname" class="control-label">患者姓名</label>
                      <input type="text" id="image_patientname" class="form-control" data-placement="top"
                             data-original-title="" placeholder="" ng-model="search.name">
                    </div>
                  </div>
                  <div class="col-sm-4">
                    <div class="form-group">
                      <label for="image_patientname" class="control-label">病种</label>
                      <input type="text" id="image_patient2name" class="form-control" data-placement="top"
                             data-original-title="" placeholder="" ng-model="search.part">
                    </div>
                  </div>
                  <div class="col-md-4">
                    <div class="form-group">
                      <label for="image_patientname" class="control-label">就诊时间</label>
                      <input type="text"  class="form-control" data-placement="top"
                             data-original-title="" placeholder="" ng-model="search.time">
                    </div>
                  </div>
                </div>

              </div>
            </div>
          </div>
          <div class="row">
            <div class="col-sm-12 ibox float-e-margins" style="margin-bottom: 0;">
              <div class="ibox-title">
                <h5>
                  <strong>上午治疗清单</strong>
                </h5>
                <div ibox-tools></div>
              </div>
              <div class="ibox-content" style="padding: 0;">
                <table datatable="ng" dt-options="dtOptions"  class="table table-striped table-bordered table-hover dataTables-example" style="margin: 0;">
                  <thead>
                  <tr>
                    <td class="treathead">时间</td>
                    <td class="treathead">患者列表</td>
                  </tr>
                  </thead>
                  <tbody>
                  <tr ng-repeat="model in modelList | filter:{time:search.time}">
                    <td style="width: 15%;text-align: center;vertical-align: middle;  ">{{ model.time }}</td>
                    <td style="width: 85%;padding: 0;">
                      <table style="width: 100%;">
                        <tr>
                          <td ng-repeat="patient in model.patients |filter:{name:search.name,part:search.part}" style="width: 33%;">
                            <div class="col-sm-12">
                              <div class="feed-element"  style="padding-right: 0;padding-bottom:0;margin: 0;">
                                <div class="col-sm-4" style="margin:5px 0px;padding: 0;width: 60px;">
                                  <a>
                                    <img alt="image" class="img-square" src="{{patient.headpic}}" ng-click="showTable(patient.id)">
                                  </a>
                                </div>
                                <div class="col-sm-7 media-body" style="margin-top: 10px;padding-left: 5px;">
                                  <a class="btn btn-small" style="border: none;font-size: 14px;"><strong>{{patient.name}}</strong></a><br>
                                  <a class="btn btn-xs btn-outline btn-primary" style="font-size: 12px;">{{patient.part}}</a>
                                  <a class="btn btn-xs  btn-primary"  ng-class="{true:'btn-outline'}[patient.status=='已完成']">{{patient.status}}</a>
                                </div>
                              </div>
                            </div>
                          </td>
                        </tr>
                      </table>

                    </td>
                  </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
          <div class="row">
            <div id="ibox-pm" class="col-sm-12 ibox float-e-margins" style="margin-bottom: 0;">
              <div class="ibox-title">
                <h5><strong>下午治疗清单</strong></h5>
                <div ibox-tools></div>
              </div>
              <div id="pm-content" class="ibox-content" style="padding: 0;">
                <table datatable="ng" dt-options="dtOptions"  class="table table-striped table-bordered table-hover dataTables-example" style="margin: 0;">
                  <thead>
                  <tr>
                    <td class="treathead">时间</td>
                    <td class="treathead">患者列表</td>
                  </tr>
                  </thead>
                  <tbody>
                  <tr ng-repeat="model in modelList | filter:{time:search.time}">
                    <td style="width: 15%;text-align: center;vertical-align: middle;  ">{{ model.time }}</td>
                    <td style="width: 85%;padding: 0;">
                      <table style="width: 100%;">
                        <tr>
                          <td ng-repeat="patient in model.patients |filter:{name:search.name,part:search.part}" style="width: 33%;">
                            <div class="col-sm-12">
                              <div class="feed-element"  style="padding-right: 0;padding-bottom:0;margin: 0;">
                                <div class="col-sm-4" style="margin:5px 0px;padding: 0;width: 60px;">
                                  <a>
                                    <img alt="image" class="img-square" src="{{patient.headpic}}" ng-click="showTable(patient.id)">
                                  </a>
                                </div>
                                <div class="col-sm-7 media-body" style="margin-top: 10px;padding-left: 5px;">
                                  <a class="btn btn-small" style="border: none;font-size: 14px;"><strong>{{patient.name}}</strong></a><br>
                                  <a class="btn btn-xs btn-outline btn-primary" style="font-size: 12px;">{{patient.part}}</a>
                                  <a class="btn btn-xs  btn-primary"  ng-class="{true:'btn-outline'}[patient.status=='已完成']">{{patient.status}}</a>
                                  <!-- <div class="actions" style="margin-top: 1px;">
                                     <a class="btn btn-xs btn-white" ng-click="finish()">操作</a>
                                   </div>-->
                                </div>
                              </div>
                            </div>
                          </td>
                        </tr>
                      </table>
                    </td>
                  </tr>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
        <div class="col-sm-6">
          <div class="row">
            <div class="col-sm-12">
              <div class="ibox float-e-margins">
                <div class="ibox-title">
                  <h5>{{patient.name}}&nbsp;&nbsp;治疗记录详情 </h5>
                  <div ibox-tools></div>
                </div>
                <div id="record" class="ibox-content">
                  <table class="footable table table-stripped toggle-arrow-tiny " id="mainTable"
                         data-page-size="20" >
                    <thead>
                    <tr>
                      <th>姓名</th>
                      <th>病案号</th>
                      <th>病种</th>
                      <th>处方剂量</th>
                      <th>累计剂量</th>
                      <th>缴费次数</th>
                      <th>治疗序号</th>
                      <th>状态</th>
                      <!--                      <th>医师签名</th>
                      <th>物理师签名</th>
                      <th>技师签名</th>-->
                      <th>备注</th>
                      <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="record in records track by $index">
                      <td>{{patient.name}}</td>
                      <td>{{patient.id}}</td>
                      <td>{{patient.part}}</td>
                      <td>{{patient.recipeDose}}Gy/{{patient.planTimes}}f</td>
                      <td>{{patient.recipeDose * ($index+1) | dose:(patient.recipeDose/patient.planTimes * ($index+1)):$index:patient.treatTimes}}Gy</td>
                      <td>{{patient.payTimes}}</td>
                      <td>{{$index+1}}</td>
                      <td>{{record.status | treatStatus:$index:patient.treatTimes}}</td>
                     <!-- <td><img ng-src="{{patient.dr |drSignature:$index:patient.treatTimes:patient.dr}}" style="width: 50px;height: 30px;"></td>
                      <td><img ng-src="{{patient.dr2 |drSignature:$index:patient.treatTimes:patient.dr2}}" style="width: 50px;height: 30px;"></td>
                      <td><img ng-src="{{patient.dr3 |drSignature:$index:patient.treatTimes:patient.dr3}}" style="width: 50px;height: 30px;"></td>-->
                      <td>{{record.remarks}}</td>
                      <td><button class="btn btn-xs  btn-primary" ng-click="finish()" ng-disabled="$index<patient.treatTimes || $index>patient.treatTimes">完成</button></td>
                    </tr>
                    </tbody>
                    <tfoot>
                    <tr>
                      <td colspan="50">
                        <ul class="pagination pull-right"></ul>
                      </td>
                    </tr>
                    </tfoot>
                  </table>
                </div>
              </div>
            </div>
          </div>
        </div>
    </div>
  </div>
</div>
